package com.moli.lumpSugar.transaction.service;//package com.moli.lumpSugar.common.service;


import com.moli.lumpSugar.common.constant.MQConstant;
import com.moli.lumpSugar.common.domain.dto.PushMessageDTO;
import com.moli.lumpSugar.common.domain.dto.WSBaseResp;
import com.moli.lumpSugar.common.domain.vo.response.WSLoginSuccessMQMsg;
import com.moli.lumpSugar.transaction.service.MQProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Description:
 * Author: zhangjt
 * Date: 2024-11-05
 */
@Service
public class PushService {
    @Autowired
    private MQProducer mqProducer;

    public void sendPushMsg(WSBaseResp<?> msg, List<Long> uidList) {
        mqProducer.sendMsg(MQConstant.PUSH_TOPIC, new PushMessageDTO(uidList, msg));
    }

    public void sendPushMsg(WSBaseResp<?> msg, Long uid) {
        mqProducer.sendMsg(MQConstant.PUSH_TOPIC, new PushMessageDTO(uid, msg));
    }

    public void sendPushMsg(WSBaseResp<?> msg) {
        mqProducer.sendMsg(MQConstant.PUSH_TOPIC, new PushMessageDTO(msg));
    }

    public void sendPushLoginMsg(WSLoginSuccessMQMsg msg) {
        mqProducer.sendMsg(MQConstant.LOGIN_MSG_TOPIC, msg);
    }
}
